home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / security / ipacl / example.cfg < prev    next >
Encoding:
Text File  |  1993-01-12  |  5.1 KB  |  215 lines

  1. #
  2. # Configuration file example for ipacl
  3. # ------------------------------------
  4. #
  5. # Let's assume the following scenario:
  6. #
  7. # - We have a local area network with a couple of hosts.
  8. # - We want to connect to the internet.
  9. # - Only one of our hosts shall have internet access, we call this
  10. #   host piggy.edu. All other hosts in our local network
  11. #   do *not* have direct internet access. We use IPACL to
  12. #   make some access restrictions for piggy.edu.
  13. # - The rest of our local network shall be protected
  14. #   from the internet.
  15. # - For security reasons we only want to allow connections
  16. #   outgoing from piggy.edu into the internet and disallow
  17. #   incoming connections (except for smtp, nntp and name server
  18. #   connections, which are necessary to receive mails and news feed).
  19. # - We also disallow telnet/ftp/... connections from piggy.edu
  20. #   into our local net (except smtp), but any host in our local
  21. #   net can telnet/ftp/mail/... to piggy.edu.
  22. # - Piggy.edu has 2 network interfaces, one connectiong
  23. #   to the internet, the other one connectiong to the local net.
  24. #   Piggy.edu does *not* route packetes between our local net
  25. #   and the internet (IPFORWARDING in the kernel is set to off).
  26. #
  27. # The following picture shows our configuration:
  28. #
  29. #          +--------------------------+
  30. #          | Our internet host        |
  31. #          | `piggy.edu'              |
  32. #          +------+------------+------+
  33. #       piggy.edu |            | piggy-2.edu
  34. # <---------------+            +--------------->
  35. # INTERNET                Our local network - all the
  36. #                    hosts in the local network are
  37. #                    to be protected from internet.
  38. #
  39. # IPACL access list (configuration file) we install on piggy.edu:
  40. #
  41.  
  42.     #------------
  43.     # The adresses of all the host's interfaces -
  44.     # we have the loop interface and 2 ethernet boards
  45.     #------------
  46.  
  47. SELF       = { "localhost", "piggy.com", "piggy-2.com" }
  48.  
  49.     #------------
  50.     # The address set `LOCAL' describes all the hosts in
  51.     # our local net. All hosts not in this set are
  52.     # assumed to reside in the internet.
  53.     #------------
  54.  
  55. NET_37     = 37.0.0.0 mask 0xff000000
  56. NET_L2     = 236.5.3.0 mask 0xffffff00
  57. LOCAL      = { NET_37, NET_L2, "dog.edu", 174.32.5.13 }
  58.  
  59.     #------------
  60.     # Any host in our local net is allowed to use
  61.     # the following services on our host
  62.     #------------
  63.     
  64. OUR_SERVICES_FOR_LOCAL = {
  65.    port "smtp/tcp",        # Mail
  66.    port "nntp/tcp",        # News
  67.    port "telnet/tcp",        # Telnet
  68.    port "ftp/tcp",        # FTP
  69.    port "ftp-data/tcp",        # FTP
  70.    port "pop-3/tcp",        # Post office protocol (mail)
  71.    port "domain/tcp",        # Name server
  72.    port "domain/udp"        # Name server
  73. }
  74.  
  75.     #------------
  76.     # Any host in the INTERNET is allowed to connect to
  77.     # the following services on piggy.edu
  78.     #------------
  79.  
  80. OUR_SERVICES_FOR_INTERNET = {
  81.    port "smtp/tcp",
  82.    port "nntp/tcp",
  83.    port "domain/tcp",
  84.    port "domain/udp"
  85. }
  86.  
  87.     #------------
  88.     # Our host is allowed to connect to
  89.     # the following services on every host in the local net
  90.     #------------
  91.  
  92. LOCAL_SERVICES_FOR_US = {
  93.    port "smtp/tcp"
  94. }
  95.  
  96.     #------------
  97.     # Our host is allowed to connect to
  98.     # the following services on every host in the INTERNET
  99.     #------------
  100.  
  101. INTERNET_SERVICES_FOR_US = {
  102.    port "smtp/tcp",        # Mail
  103.    port "nntp/tcp",        # News
  104.    port "telnet/tcp",
  105.    port "ftp/tcp",
  106.    port "ftp-data/tcp",
  107.    port "domain/tcp",
  108.    port "domain/udp",
  109.    port 1525/udp             # archie server
  110. }
  111.  
  112. #****************** END OF DEFINITIONS ************************************
  113.  
  114. START:
  115.    src in SELF         -> OUTGOING
  116.  
  117.     #------------
  118.     # Handle incoming packets    
  119.     #------------
  120.  
  121. INCOMING:
  122.  
  123.     # We assume that everything, that is not part of
  124.     # our local net comes from anywhere in the INTERNET
  125.  
  126.    src !in LOCAL    -> INCOMING_FROM_INTERNET
  127.  
  128.     #------------
  129.     # Handle incoming packets from our local net
  130.     #------------
  131.  
  132. INCOMING_FROM_LOCAL:
  133.  
  134.     # Connection to telnet, ftp, ...
  135.  
  136.    dst in OUR_SERVICES_FOR_LOCAL -> accept
  137.  
  138.     # Accept responses from SMTP, where we have connected to
  139.  
  140.    src in LOCAL_SERVICES_FOR_US -> accept
  141.  
  142.     # reject everything else
  143.  
  144.    deny
  145.  
  146.     #------------
  147.     # Handle incoming packets from INTERNET
  148.     #------------
  149.  
  150. INCOMING_FROM_INTERNET:
  151.  
  152.     # Connection for mail, news, DNS, ...
  153.  
  154.    dst in OUR_SERVICES_FOR_INTERNET   -> accept
  155.  
  156.     # accept responses from the services we connect to ...
  157.  
  158.    src in INTERNET_SERVICES_FOR_US   -> accept
  159.  
  160.     # reject everything else
  161.  
  162.    deny
  163.  
  164.     #------------
  165.     # Handle outgoing packets
  166.     #------------
  167.  
  168. OUTGOING:
  169.  
  170.     # Packets, that our host sends to itself
  171.  
  172.    dst in SELF        -> accept
  173.  
  174.     # We assume, that everything, that does not belong
  175.     # to our local net is somewhere in the INTERNET
  176.  
  177.    dst !in LOCAL    -> OUTGOING_TO_INTERNET
  178.  
  179.     #------------
  180.     # Check packets sent to our local network
  181.     #------------
  182.  
  183. OUTGOING_TO_LOCAL:
  184.  
  185.     # Responses for telnet, ftp, ...
  186.  
  187.    src in OUR_SERVICES_FOR_LOCAL -> accept
  188.  
  189.     # Mail delivered from our host to a host in our local net
  190.  
  191.    dst in LOCAL_SERVICES_FOR_US -> accept
  192.  
  193.     # reject everything else
  194.  
  195.    deny
  196.  
  197.     #------------
  198.     # Check packets sent to INTERNET
  199.     #------------
  200.  
  201. OUTGOING_TO_INTERNET:
  202.  
  203.     # Responses for news, mail, domain, ...
  204.  
  205.    src in OUR_SERVICES_FOR_INTERNET    -> accept
  206.  
  207.     # Connections into the INTERNET, ...
  208.  
  209.    dst in INTERNET_SERVICES_FOR_US   -> accept
  210.  
  211.     # reject everything else
  212.  
  213.    deny
  214.  
  215.